if(GTest_FOUND)
     #test executables
     add_executable(XyceSimulatorUnitTests XyceSimulatorUnitTests.C)
     target_link_libraries(XyceSimulatorUnitTests PUBLIC XyceLib GTest::gtest)

     # Some tests require a data file; put them in the right place
     file(COPY
          ${CMAKE_CURRENT_SOURCE_DIR}/TestNetlist1.cir
          ${CMAKE_CURRENT_SOURCE_DIR}/TestNetlist2.cir
          ${CMAKE_CURRENT_SOURCE_DIR}/TestNetlist3.cir
          DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

     # Wrap the GTest tests with CTest
     gtest_discover_tests( XyceSimulatorUnitTests TEST_PREFIX XyceSimulatorUnit:)
endif()